//
//  MHRecentMessageTableViewCell.m
//  MiaoCircle
//
//  Created by 许正荣 on 2018/5/30.
//  Copyright © 2018年 acgera. All rights reserved.
//

#import "MHSearchCircelCell.h"
#import "MHRecentMessageItemViewModel.h"
#import "NSMutableAttributedString+MHMoment.h"
#import "MHPicture.h"
#import "MHCustomItemViewModel.h"
#import "MHSearchCircleModel.h"
@interface MHSearchCircelCell()
//@property(nonatomic,strong) MHAskItemViewModel *viewModel;
@end

@implementation MHSearchCircelCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
//    self.nameLable.font =
    self.nameLable.font = MHRegularFont_15;
    self.descLabel.font = MHRegularFont_11;
    self.amountLabel.font = MHRegularFont_11;
    self.locationBtn.titleLabel.font = MHRegularFont_11;
    
//    self.attrImage.clipsToBounds = YES;
    
}


-(void)bindViewModel:(MHCustomItemViewModel *)viewModel
{
    MHSearchCircleModel *dataModel =  viewModel.model;
    self.nameLable.text = dataModel.title;
    self.descLabel.text = dataModel.circleIntro;
    self.amountLabel.text = [NSString stringWithFormat:@"主题 %ld",(long)dataModel.recentCount];
    [self.circleBg yy_setImageWithURL:[NSURL URLWithString:dataModel.fullCoverUrl] placeholder:MHDefaultAvatar(MHDefaultAvatarTypeDefualt)];
    self.payIconImge.hidden = (dataModel.payType != MHCirclPayTypeCharge);
    self.locationBtn.hidden = !dataModel.location.isShowLocation;
    [self.locationBtn setTitle:[NSString stringWithFormat:@" %@",dataModel.location.areaName] forState:0];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
